package cn.tedu.spring.di;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestUserDao {
    public static void main(String[] args) {
        /*
        1.创建spring Bean对象,并存入IoC容器中[ApplicationContext接口];
        2.从IoC容器中获取Bean对象[getBean(类型.class)方法];
        3.打印测试
         */
        ApplicationContext context=new AnnotationConfigApplicationContext("cn.tedu.spring.di");
        UserService userService=context.getBean(UserService.class);
        System.out.println(userService);





    }
}
